package com.cskaoyan.controller;

import com.cskaoyan.vo.BaseRespVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @author stone
 * @date 2022/08/31 11:24
 */
@Controller
public class UserController {

    // localhost:8080/user/login      → {"msg":"ok","status":200}
    @RequestMapping("user/login")
    @ResponseBody // 将引用类型的实例转换为Json字符串
    public BaseRespVo login(HttpServletRequest request) {
        BaseRespVo baseRespVo = new BaseRespVo();
        baseRespVo.setMsg("ok");
        baseRespVo.setStatus(200);
        return baseRespVo;
    }

}
